/*
 * $Id: PolisApplicationTestCase.java 27 2007-04-13 01:02:48Z aaron.day $
 */
package org.crazydays.core.data;


import org.hibernate.Session;
import org.hibernate.HibernateException;

import junit.framework.TestCase;

import org.crazydays.hibernate.HibernateUtil;

/**
 * PolisApplicationTestCase
 */
public class PolisApplicationTestCase
	extends TestCase
{
	/**
	 * Test manage users.
	 */
	public void testManageUsers()
	{
		Session session = HibernateUtil.getSession();
		try {
			PolisApplication application = (PolisApplication) HibernateUtil
					.loadPolisDataByName(session,
							PolisApplication.class,
							"Manage Users");

			assertNotNull("application == null", application);

			PolisAcl acl = application.getAcl();
			assertNotNull("acl == null", acl);
			assertEquals("acl.name != Admin", acl.getName(),
					"Admin");
		} catch (HibernateException e) {
			fail("HibernateException: " + e.getMessage());
		} finally {
			if (session != null) {
				session.close();
			}
		}
	}
}
